package com.qfedu.edu.messagecenterserver.controller;


import com.qfedu.edu.messagecenterserver.result.Result;
import com.qfedu.edu.messagecenterserver.service.DeviceService;
import com.qfedu.edu.vo.DriverMqttAuthVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 设备表 前端控制器
 * </p>
 *
 * @author xiaobobo
 * @since 2024-09-30
 */
@RestController
@RequestMapping("/messagecenterserver/device")
@Api(description = "设备模块",tags = "设备模块")
public class DeviceController {

    @Autowired
    private DeviceService deviceService;
    /**
     * 硬件登陆
     * @param driverMqttAuthVo
     * @return
     */
    @PostMapping("/hardware/auth")
    @ApiOperation("硬件登陆接口")
    public Result<DriverMqttAuthVo> auth(@RequestBody DriverMqttAuthVo driverMqttAuthVo){
        driverMqttAuthVo=deviceService.auth(driverMqttAuthVo);
        return Result.ok(driverMqttAuthVo);
    }

}

